﻿using Wx.Standard.Enum;
using Wx.Standard.Model.Pay;

namespace Wx.Standard.IService
{
    public interface IPay
    {
        /// <summary>
        /// 统一下单 trade_type=NATIVE时返回code_url 不是则返回prepay_id
        /// </summary>
        /// <param name="orderMoney">订单金额 单位元</param>
        /// <param name="orderNo">商户系统内部订单号，要求32个字符内，只能是数字、大小写字母_-|* 且在同一个商户号下唯一</param>
        /// <param name="body">简单描述</param>
        /// <param name="ePay">支付类型 NATIVE时返回code_url 不是则返回prepay_id</param>
        /// <param name="openid">ePay为JSAPI时，openid为必填参数</param>
        /// <param name="productId">商品ID,trade_type=NATIVE时（即扫码支付），此参数必传。此参数为二维码中包含的商品ID</param>
        /// <returns></returns>
        string UnifiedOrder(decimal orderMoney, string orderNo, string body, EPay ePay, string openid = "", string productId = "");
        /// <summary>
        /// 支付通知,验证通过返回非空对象,通不过则返回空,所以前端直接判断是否空就行 然后再进行金额等判断
        /// </summary>
        /// <returns></returns>
        Pay_Result NotifyPay();
        /// <summary>
        /// JSAPI所需求的一些参数
        /// </summary>
        /// <param name="prepay_id">统一下单接口返回的prepay_id参数值</param>
        /// <returns></returns>
        Pay_JsAPI JsPayInfo(string prepay_id);
        /// <summary>
        /// APP支付需求的一些参数
        /// </summary>
        /// <param name="prepay_id">统一下单接口返回的prepay_id参数值</param>
        /// <returns></returns>
        Pay_AppApi AppPayInfo(string prepay_id);
        /// <summary>
        /// 退款
        /// </summary>
        /// <param name="refundNo">退款单号</param>
        /// <param name="tradeNo">发生交易的单号</param>
        /// <param name="totalMoney">总金额 元</param>
        /// <param name="refundMoney">退款金额 元</param>
        /// <returns></returns>
        bool Refund(string refundNo, string tradeNo, decimal refundMoney, decimal totalMoney);
        /// <summary>
        /// 退款通知
        /// </summary>
        /// <returns></returns>
        Pay_Refund_Result RefundResultNotifyPay();

    }
}
